package org.example.utils;

import cn.hutool.core.util.IdUtil;
import org.example.model.CardInfo;
import org.example.model.User;

import java.util.HashMap;
import java.util.Map;

/**
 * @author huangy
 * @description
 * @since 2023/2/22 20:21
 **/
public class UserUtils {

    /*
     * @description 创建用户信息
     * @author huangy
     * @since 2023/2/22 20:23
     * @return org.example.model.User
     **/
    public static User createUser() {
        User user = new User();
        user.setId(IdUtil.getSnowflakeNextId());
        user.setName(RandomUtils.randomChineseName());
        user.setAge(10);
        CardInfo cardInfo = new CardInfo();
        cardInfo.setId(IdUtil.getSnowflakeNextId());
        cardInfo.setCode("code1212112");
        user.setCardInfo(cardInfo);
        Map<String, String> props = new HashMap<>();
        props.put("1", "abc");
        props.put("2", "abc1");
        props.put("3", "abc2");
        user.setProps(props);
        return user;
    }

    private UserUtils() {
        throw new UnsupportedOperationException();
    }

}
